]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
tests: fix up typelib include paths
authorDan Winship <danw@gnome.org>
Wed, 18 May 2011 18:52:27 +0000 (14:52 -0400)
committerDan Winship <danw@gnome.org>
Wed, 27 Jul 2011 13:29:03 +0000 (09:29 -0400)
The js modules have so many imports back and forth that it's pretty
much guaranteed that if you import even one of them, you'll end up
importing all of them, including ui.status.bluetooth and
ui.status.network. So fix up the typelib include paths the same way
gnome-shell-jhbuild does, so we can find everything.

https://bugzilla.gnome.org/show_bug.cgi?id=650298

src/run-js-test.c
tests/Makefile.am
tests/run-test.sh.in

index 41fb37c18050cb2753f6f8a6c20f5cf1f69b23d3..c89d26fd5ad9b0eeeda86dc64df2bbe8c9ae6697 100644 (file)
 
 #include <clutter/x11/clutter-x11.h>
 #include <gdk/gdkx.h>
+#include <girepository.h>
 #include <gjs/gjs.h>
 #include <gtk/gtk.h>
 
 #include "shell-global.h"
 #include "shell-global-private.h"
 
-static char **include_path = NULL;
 static char *command = NULL;
 
 static GOptionEntry entries[] = {
   { "command", 'c', 0, G_OPTION_ARG_STRING, &command, "Program passed in as a string", "COMMAND" },
-  { "include-path", 'I', 0, G_OPTION_ARG_STRING_ARRAY, &include_path, "Add the directory DIR to the list of directories to search for js files.", "DIR" },
   { NULL }
 };
 
@@ -131,6 +130,14 @@ main(int argc, char **argv)
   clutter_stage_set_title (CLUTTER_STAGE (stage), title);
   g_free (title);
 
+#if HAVE_BLUETOOTH
+  /* The module imports are all so intertwined that if the test
+   * imports anything in js/ui, it will probably eventually end up
+   * pulling in ui/status/bluetooth.js. So we need this.
+   */
+  g_irepository_prepend_search_path (BLUETOOTH_DIR);
+#endif
+
   /* evaluate the script */
   error = NULL;
   if (!gjs_context_eval (js_context, script, len,
index 172dc998a1f9e272996ce60c4ec7255cefcdac93..fe3ff565a8db31f20dc48c00d735039aafe9deb5 100644 (file)
@@ -28,6 +28,7 @@ EXTRA_DIST += $(TEST_MISC)
 run-test.sh: run-test.sh.in
        $(AM_V_GEN) sed \
            -e "s|@MUTTER_TYPELIB_DIR[@]|$(MUTTER_TYPELIB_DIR)|" \
+           -e "s|@JHBUILD_TYPELIBDIR[@]|$(JHBUILD_TYPELIBDIR)|" \
            -e "s|@srcdir[@]|$(srcdir)|" \
            $< > $@ && chmod a+x $@
 
index ee1472fedf89c8845c700b37d7c78a7a2de70595..0a01473107490fc93b14dc6fdc25ac58f1ae2555 100755 (executable)
@@ -30,7 +30,7 @@ builddir=`cd $builddir && pwd`
 srcdir=$builddir/@srcdir@
 srcdir=`cd $srcdir && pwd`
 
-GI_TYPELIB_PATH="@MUTTER_TYPELIB_DIR@:$builddir/../src"
+GI_TYPELIB_PATH="$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}@MUTTER_TYPELIB_DIR@:@JHBUILD_TYPELIBDIR@:$builddir/../src"
 GJS_PATH="$srcdir:$srcdir/../js"
 GJS_DEBUG_OUTPUT=stderr
 $verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"